<?php

class Fw_Action extends Fw_View
{
	protected $_model;
	
	protected function _getModel($module)
    {
		$modelClass = 'Model_'.$module;
        if (null === $this->_model) {
			$modelExplode = substr($module, 0, 2);
			$modelName = str_replace($modelExplode, $modelExplode.'-', $module);
			require_once APPLICATION_PATH . 'modules/'.strtolower($modelName).'/models/'.$module.'.php';
            $this->_model = new $modelClass();
        }
        return $this->_model;
    }
	
	public function validateUser($id) {
		$storage = new Zend_Auth_Storage_Session();
		$data = $storage->read();
		if(($id == $data->id) || ($data->user_type == 'A')) {
			return true;
		} else {
			return $this->_helper->redirector('list');
		}
	}
}